﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace GatherWebLib
{
   public class cGlobalParas
    {

       /// <summary>
       /// 使用状态
       /// </summary>
       public enum EnumStatus
       {
           /// <summary>
           /// 无效
           /// </summary>
           [Description("无效")]
           NoValid = 0,
           /// <summary>
           /// 有效
           /// </summary>
           [Description("有效")]
           Valid = 1
       }

        /// <summary>
        /// 任务状态
        /// </summary>
        public enum TaskState
        {
            UnStart = 1010,
            Started = 1011,
            Aborted = 1012,
            Waiting = 1013,
            Running = 1014,
            Pause = 1015,
            Stopped = 1016,
            Exporting = 1017,
            Completed = 1018,
            Failed = 1019,
            Publishing = 1020,
        }

        /// <summary>
        /// 当前网页地址采集状态
        /// </summary>
        public enum UrlGatherResult
        {
            UnGather = 2031,
            Succeed = 2032,
            Error = 2033,
            Gathered = 2034,
        }
        /// <summary>
        /// 页面内容编码
        /// </summary>
        public enum WebCode
        {
            /// <summary>
            /// 默认
            /// </summary>
            auto = 0,
            /// <summary>
            /// gb2312
            /// </summary>
            gb2312 = 1,
            /// <summary>
            /// utf8
            /// </summary>
            utf8 = 2,
            /// <summary>
            /// gbk
            /// </summary>
            gbk = 3,
            /// <summary>
            /// big5
            /// </summary>
            big5 = 4,
            /// <summary>
            /// NoCoding
            /// </summary>
            NoCoding = 5,
        }
     
       
       /// <summary>
       /// 任务采集方式
       /// </summary>
        public enum TaskType
        {
            /// <summary>
            /// 根据网站采集数据
            /// </summary>
            [Description("根据网站网址采集数据")]
            HtmlByWeb = 1,
            /// <summary>
            /// 采集ajax页面数据
            /// </summary>
            [Description("采集ajax页面数据")]
            AjaxHtmlByUrl = 2,
        }

       /// <summary>
       /// 任务执行类型
       /// </summary>
        public enum TaskRunType
        {
            /// <summary>
            /// 仅采集数据
            /// </summary>
            OnlyGather = 1,
            /// <summary>
            /// 采集并发布
            /// </summary>
            GatherExportData = 2,
        }
        /// <summary>
        /// 抓取到数据的类型
        /// </summary>
        public enum DataType
        {
            /// <summary>
            /// 文本
            /// </summary>
             [Description("文本")]
            Txt = 1,
             /// <summary>
             /// 图片
             /// </summary>
             [Description("图片")]
            Picture = 2,
             /// <summary>
             /// Flash
             /// </summary>
             [Description("Flash")]
            Flash = 3,
             /// <summary>
             /// 文件
             /// </summary>
             [Description("文件")]
            File = 4,
        }
        /// <summary>
        /// 匹配规则
        /// </summary>
        public enum LimitSign
        {
            /// <summary>
            /// 不做任意格式的限制
            /// </summary>
            [Description("不做任意格式的限制")]
            NoLimit = 1,          
            /// <summary>
            /// 匹配时去掉网页符号
            /// </summary>
            [Description("匹配时去掉网页符号")]
            NoWebSign = 2,      
            /// <summary>
            /// 只匹配中文
            /// </summary>
            [Description("只匹配中文")]
            OnlyCN = 3,          
            /// <summary>
            /// 只匹配双字节字符
            /// </summary>
            [Description("只匹配双字节字符")]
            OnlyDoubleByte = 4,  
            /// <summary>
            /// 只匹配数字
            /// </summary>
            [Description("只匹配数字")]
            OnlyNumber = 5,         
            /// <summary>
            /// 只匹配字母数字及常用字符
            /// </summary>
            [Description("只匹配字母数字及常用字符")]
            OnlyChar = 6,           
            /// <summary>
            /// 自定义正则匹配表达式
            /// </summary>
            [Description("自定义正则匹配表达式")]
            Custom = 7,           
        }
        
       /// <summary>
       /// 下载结果
       /// </summary>
        public enum DownloadResult
        {
            Succeed = 1081,
            Failed = 1082,
            Err = 1083,
        }
        /// <summary>
        /// 输出规则类型
        /// </summary>
        public enum ExportLimit
        {
            /// <summary>
            /// 不做输出控制
            /// </summary>
            [Description("不做输出控制")]
            ExportNoLimit = 0,
            /// <summary>
            /// 输出时去掉网页符号
            /// </summary>
            [Description("输出时去掉网页符号")]
            ExportNoWebSign = 1,
            /// <summary>
            /// 输出时附加前缀
            /// </summary>
            [Description("输出时附加前缀")]
            ExportPrefix = 2,
            /// <summary>
            /// 输出时附加后缀
            /// </summary>
            [Description("输出时附加后缀")]
            ExportSuffix = 3,
            /// <summary>
            /// 左起去掉字符
            /// </summary>
            [Description("左起去掉字符")]
            ExportTrimLeft = 4,
            /// <summary>
            /// 右起去掉字符
            /// </summary>
            [Description("右起去掉字符")]
            ExportTrimRight = 5,
            /// <summary>
            /// 替换其中符合条件的字符
            /// </summary>
            [Description("替换其中符合条件的字符")]
            ExportReplace = 6,      //
            /// <summary>
            /// 去掉字符串首尾空格
            /// </summary>
            [Description("去掉字符串首尾空格")]
            ExportTrim = 7,
            /// <summary>
            /// 输出时采用正则表达式进行替换
            /// </summary>
            [Description("输出时采用正则表达式进行替换")]
            ExportRegexReplace = 8,


        }

        /// <summary>
        /// 发布类型
        /// </summary>
        public enum PublishType
        {
            /// <summary>
            /// 不发布
            /// </summary>
            NoPublish = 0,
            /// <summary>
            /// 发布到Access
            /// </summary>
            PublishAccess = 1,
            /// <summary>
            /// 发布到Sql
            /// </summary>
            PublishMSSql = 2,
            /// <summary>
            /// 发布到Txt
            /// </summary>
            PublishTxt = 3,
            /// <summary>
            /// 发布到Excel
            /// </summary>
            PublishExcel = 4,
            /// <summary>
            /// 发布到MySql
            /// </summary>
            PublishMySql = 5,
            /// <summary>
            /// 发布到网站
            /// </summary>
            PublishWeb = 6,
          
        }

        /// <summary>
        /// 数据库类型
        /// </summary>
        public enum DatabaseType
        {
            /// <summary>
            /// Access
            /// </summary>
            Access = 1,
            /// <summary>
            /// MSSqlServer
            /// </summary>
            MSSqlServer = 2,
            /// <summary>
            /// MySql
            /// </summary>
            MySql = 3,
        }
       /// <summary>
       /// 日志类型
       /// </summary>
        public enum LogType
        {
            /// <summary>
            /// 详情
            /// </summary>
            Info = 2061,
            /// <summary>
            /// 错误
            /// </summary>
            Error = 2062,
            /// <summary>
            /// 警告
            /// </summary>
            Warning = 2063,
            RunPlanTask = 2064,
            /// <summary>
            /// 抓取错误
            /// </summary>
            GatherError = 2065,
            /// <summary>
            /// 发布错误
            /// </summary>
            PublishError = 2066,
        }
    }
}
